<?php
	$lat = -7.7572418; //Deklarasi nilai latitude
	$lon = 110.40585130000001; //Deklarasi nilai longitude
	$lat1 = $lat/$divider;
	$lon1 = $lon/$divider;
	$rs = mysql_query("select id_rs, nama_rs, kelas, alamat, telp, website, (6371 * 2 * atan2(sqrt((sin(((latitude/$divider) - ($lat1))/2) * sin(((latitude/$divider) - ($lat1))/2)) + cos($lat1) * cos(latitude/$divider) * sin(((longitude/$divider) - ($lon1))/2) * sin(((longitude/$divider) - ($lon1))/2)), sqrt(1 - ((sin(((latitude/$divider) - ($lat1))/2) * sin(((latitude/$divider) - ($lat1))/2)) + cos($lat1) * cos(latitude/$divider) * sin(((longitude/$divider) - ($lon1))/2) * sin(((longitude/$divider) - ($lon1))/2))))) as jarak, (select count(id_ruang) from ruang where id_rs = rs.id_rs and status = 'N') as jml from rumah_sakit rs order by jarak");
?>	